package com.dataaccess.dataaccess.web.web;

import cn.hutool.json.JSONArray;
import com.dataaccess.dataaccess.common.base.BaseController;
import com.dataaccess.dataaccess.support.annotaion.Action;
import com.dataaccess.dataaccess.support.annotaion.At;
import com.dataaccess.dataaccess.support.model.RespEntity;
import com.dataaccess.dataaccess.web.service.BulkInsertService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @author Yang
 */
@Action
public class BulkInsertController extends BaseController {

    @Resource
    private BulkInsertService bulkInsertService;


    /**
     *
     * @param jsonParam
     * @return
     * @throws Exception
     */
    @At(value = "FireDepartment/add", method = RequestMethod.POST)
    public RespEntity add2(@RequestBody(required = false) JSONArray jsonParam) throws Exception {

        return bulkInsertService.addUpload(jsonParam);
    }
}
